																		-- ================= HERO
Hero = Character:new{}





Hero.sprite = { 
		image = "resources/char.png",
		wid = 24,
		hig = 32,
  -- animations for cardinal directions
    default = {
	  	animation = {6,7,8,7},
	  	duration = 300
	  },
    north = {
	  	animation = {0,1,2,1},
	  	duration = 300
	  },
    northeast = {
	  	animation = {0,1,2,1},
	  	duration = 300
	  },
    east = {
	  	animation = {3,4,5,4},
	  	duration = 300
	  },
    southeast = {
	  	animation = {6,7,8,7},
	  	duration = 300
	  },
    south = {
	  	animation = {6,7,8,7},
	  	duration = 300
	  },
    southwest = {
	  	animation = {6,7,8,7},
	  	duration = 300
	  },
    west = {
	  	animation = {9,10,11,10},
	  	duration = 300
	  },
    northwest = {
	  	animation = {0,1,2,1},
	  	duration = 300
	  }
  }




	
function Hero.load()
	Hero.save = INI.load("hero/hero.ini")
	-- Info
	Hero.name = Hero.save.info.name
	Hero.class = Hero.save.info.class
	
	-- Stats
	Hero.skp = Hero.save.skillpoints.freeskillpoints * 1-- Unused skillpoints
	Hero.str = Hero.save.skillpoints.strenght
	Hero.agi = Hero.save.skillpoints.agility
	Hero.int = Hero.save.skillpoints.inteligence
	Hero.dex = Hero.save.skillpoints.dexterity 
	
	-- Hero Status
	Hero.level = Hero.save.status.level * 1
	Hero.exp = Hero.save.status.experiencepoints * 1
	Hero.hp = Hero.save.status.life * 1
	Hero.hpmax = Hero.save.status.lifemax * 1
	Hero.hpregrate = Hero.save.status.lifereg * 1
	Hero.mana = Hero.save.status.mana * 1
	Hero.manamax = Hero.save.status.manamax * 1
	Hero.manaregrate = Hero.save.status.manareg * 1
	Hero.speed =  Hero.save.status.speed * 1
	
	Hero.arrows = Hero.save.status.arrows * 1
	
	Hero.dead = 0
	
	-- Heros measure
	Hero.x = 5
	Hero.y = 50
	Hero.wid = 24
	Hero.hig = 32
	
	-- -- -- -- -- -- -- --
	-- -- ITEMS -- -- -- -
	-- -- -- -- -- -- -- --
	Hero.items = {}
	Hero.items.head= Hero.save.items.head
	Hero.items.handleft = Hero.save.items.handleft
	Hero.items.handright = Hero.save.items.handright
	Hero.items.body = Hero.save.items.body
	Hero.items.legs = Hero.save.items.legs
	Hero.items.feeds = Hero.save.items.feeds
end

function Hero.savegame()
	-- Info
	Hero.save["info"]["name"] = "Hero.name"
	Hero.save["info"]["class"] = "Hero.class"
	
	-- Status
	Hero.save["status"]["level"] = "Hero.level"
	Hero.save["status"]["life"] = "Hero.hp"
	Hero.save["status"]["lifemax"] = "Hero.hpmax"
	Hero.save["status"]["mana"] = "Hero.mana"
	Hero.save["status"]["manareg"] = "Hero.manareg"
	Hero.save["status"]["manamax"] = "Hero.manamax"
	Hero.save["status"]["speed"] = "Hero.speed"
	Hero.save["status"]["speed"] = "Hero.arrows"
	INI.save("hero.INI", Hero.save)
end 



Hero.shot = {}
Hero.shot.wid = 9
Hero.shot.hig = 9
Hero.shotx = {}
Hero.shoty = {}
Hero.shotdir = {}
Hero.shotmax = 0
Hero.shot.shoot = 0
Hero.shotkill = 0
Hero.currentState = States.control.runing

